From: Leo Date: Sun, 3 Oct 2010 01:27:39 +0000 (-0400) Subject: Fix return value of dnd-get-local-file-name (Bug#7090). X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~18^2~434 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=4ea812d2b55231fc9a5e08fcd7784889dab5dd5f;p=emacs.git Fix return value of dnd-get-local-file-name (Bug#7090). * lisp/dnd.el (dnd-get-local-file-name): If MUST-EXIST is non-nil, only return non-nil if the file exists (Bug#7090). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2c279a04c00..f7cd456bab0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-10-03 Leo + + * dnd.el (dnd-get-local-file-name): If MUST-EXIST is non-nil, only + return non-nil if the file exists (Bug#7090). + 2010-09-30 Stefan Monnier * minibuffer.el (completion--replace): diff --git a/lisp/dnd.el b/lisp/dnd.el index d7cbb641bab..aadfad6d7ac 100644 --- a/lisp/dnd.el +++ b/lisp/dnd.el @@ -154,10 +154,11 @@ Return nil if URI is not a local file." (let* ((decoded-f (decode-coding-string f (or file-name-coding-system - default-file-name-coding-system))) - (try-f (if (file-readable-p decoded-f) decoded-f f))) - (when (file-readable-p try-f) try-f))))) - + default-file-name-coding-system)))) + (setq f (cond ((file-readable-p decoded-f) decoded-f) + ((file-readable-p f) f) + (t nil))))) + f)) (defun dnd-open-local-file (uri action) "Open a local file.